/**
 * 功能描述
 */

define(function (require, exports, module) {
	var Form = require("form");
	var aw = require("ajaxwrapper");
	var Dialog = require("dialog");
	
    var instance = {
        initComponent: function (params,widget) {
        	var detailForm = new Form({
        		parentNode: ".J-detailForm",
        		model: {
        			id: "form",
        			layout: "3_1",
        			saveaction: function() {
						widget.handler.detailForm.saveaction(widget);
						detailForm.reset();
        				widget.show([".J-form",".J-endGrid",".J-total"]).hide([".J-grid",".J-detailForm"]);
        				widget.get("subnav").show(["return","save"]).hide(["statementStatus","alliance","servicePoint","destination", "time"]);
                    },
                    cancelaction: function() {
                    	widget.show([".J-form",".J-endGrid",".J-total"]).hide([".J-grid",".J-detailForm"]);
        				widget.get("subnav").show(["return","save"]).hide(["statementStatus","alliance","servicePoint","destination", "time"]);
                    },
        			items: [{
        				name:"version",
        				type:"hidden",
        				defaultValue:0
        			},{
        				name:"pkCheckOutSettlement",
        				type:"hidden"
        			},{
        				name:"checkOutSettlement",
        				type:"hidden"
        			},{
        				name:"index",
        				type:"hidden"
        			},{
        				name:"travelContract",
        				type:"hidden"
        			},{
        				name:"name",
        				label:"姓名",
        				readonly:true,
        			},{
        				name:"idNumber",
        				label:"身份证号",
        				readonly:true,
        			},{
        				name:"contractNumber",
        				label:"权证号",
        				readonly:true,
        			},{
        				name:"checkInDate",
        				label:"入住日期",
        				type:"date",
        				readonly:true,
        			},{
        				name:"checkOutDate",
        				label:"退住日期",
        				type:"date",
        				readonly:true,
        			},{
        				name:"liveDays",
        				label:"入住天数",
        				readonly:true,
        			},{
        				name: "bedSubsidyUnit",
        				type:"hidden"
        			},{
        				name:"roomCode",
        				type:"hidden"
        			},{
        				name:"roomType",
        				type:"hidden"
        			}]
        		}
        	});
        	widget.set("detailForm",detailForm);
        }
    };
    module.exports = instance;
});
